{% extends "base.html" %}

{% block content %}

<!--  uncc -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<form name='form1' id='form1' action="/allocation_set_in/" method='post' >
<table width='650' class='grid' cellspacing='1' align='center'><tr><td colspan='2' class='title'>allocation setting</td></tr>
<tr valign='middle' align='left'></tr>

<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Porject:</td>
<td class='even'><input type="hidden" name="project_id" value="4" /> <font color='red'>UNCC</font.></td></tr>
<!-- user group BEGIN -->
<tr valign='middle' align='left'><td class='odd' width='25%'>Choose area group</td>
<td class='even'>
<select name="group_id" class="group_sel">
  {% for agent in sg %}
	<option value="{{agent.id}}" {% ifequal agent.id defgroup %} selected {% endifequal %}>{{agent.name}}</option>
  {% endfor %}
</select>
</td></tr>
<!-- user group END -->
{% for sp in sp %}
{% ifequal sp.level 'sales' %}
<tr valign='middle' align='left' class='show_sel' gid="{{sp.group}}"><td class='odd' width='25%'><font color="red">*</font>{{sp.name}}:</td>
<td class='even'><input type="text" name="sp[{{sp.group}}][{{sp.id}}]" value="{% for uncc in uncclist %}{% ifequal sp.id uncc.salesperson_id %}{{uncc.rate}}{% endifequal %}{% endfor %}" />%</td></tr>

{% endifequal %}
{% endfor %}

{% if errorinfo %}
{% ifequal onproject_id '4' %}
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red"></font></td>
<td class='even'><font color="red">{{errorinfo}}</font></td></tr>
{% endifequal %}
{% endif %}

<tr valign='middle' align='left'><td class='odd' width='25%'></td>
<td class='even'>&nbsp;<input type='submit' class='button' name='submit'  id='submit' value=' Submit '  />&nbsp;&nbsp;<a href="/clear_caterecord/4/" onclick="return confirm('Are you sure to clear the old record');"><font color='red'>Clear Old Record</font></a> <font color='blue'>{{pth}}</font></form></td></tr>
</table>

<br />
<!--  harvard -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<form name='form1' id='form1' action="/allocation_set_in/" method='post' >
<table width='650' class='grid' cellspacing='1' align='center'><tr><td colspan='2' class='title'>allocation setting</td></tr>
<tr valign='middle' align='left'></tr>

<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Porject:</td>
<td class='even'><input type="hidden" name="project_id" value="10" /> <font color='red'>Harvard</font.></td></tr>
<!-- user group BEGIN -->
<tr valign='middle' align='left'><td class='odd' width='25%'>Choose area group</td>
<td class='even'>
<select name="group_id" class="group_sel">
  {% for agent in sg %}
	<option value="{{agent.id}}" {% ifequal agent.id defgroup %} selected {% endifequal %}>{{agent.name}}</option>
  {% endfor %}
</select>
</td></tr>
<!-- user group END -->
{% for sp in sp %}
{% ifequal sp.level 'sales' %}
<tr valign='middle' align='left' class='show_sel' gid="{{sp.group}}"><td class='odd' width='25%'><font color="red">*</font>{{sp.name}}:</td>
<td class='even'><input type="text" name="sp[{{sp.group}}][{{sp.id}}]" value="{% for harvard in harvardlist %}{% ifequal sp.id harvard.salesperson_id %}{{harvard.rate}}{% endifequal %}{% endfor %}" />%</td></tr>
{% endifequal %}
{% endfor %}

{% if errorinfo %}
{% ifequal onproject_id '10' %}
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red"></font></td>
<td class='even'><font color="red">{{errorinfo}}</font></td></tr>
{% endifequal %}
{% endif %}

<tr valign='middle' align='left'><td class='odd' width='25%'></td>
<td class='even'>&nbsp;<input type='submit' class='button' name='submit'  id='submit' value=' Submit '  />&nbsp;&nbsp;<a href="/clear_caterecord/10/" onclick="return confirm('Are you sure to clear the old record');"><font color='red'>Clear Old Record</font></a> <font color='blue'>{{pten}}</font></form></td></tr>
</table>

<br />
<!--  stanford -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<form name='form1' id='form1' action="/allocation_set_in/" method='post' >
<table width='650' class='grid' cellspacing='1' align='center'><tr><td colspan='2' class='title'>allocation setting</td></tr>
<tr valign='middle' align='left'></tr>

<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Porject:</td>
<td class='even'><input type="hidden" name="project_id" value="3" /> <font color='red'>Stanford</font.></td></tr>
<!-- user group BEGIN -->
<tr valign='middle' align='left'><td class='odd' width='25%'>Choose area group</td>
<td class='even'>
<select name="group_id" class="group_sel">
  {% for agent in sg %}
	<option value="{{agent.id}}" {% ifequal agent.id defgroup %} selected {% endifequal %}>{{agent.name}}</option>
  {% endfor %}
</select>
</td></tr>
<!-- user group END -->
{% for sp in sp %}
{% ifequal sp.level 'sales' %}
<tr valign='middle' align='left' class='show_sel' gid="{{sp.group}}"><td class='odd' width='25%'><font color="red">*</font>{{sp.name}}:</td>
<td class='even'><input type="text" name="sp[{{sp.group}}][{{sp.id}}]" value="{% for stanford in stanfordlist %}{% ifequal sp.id stanford.salesperson_id %}{{stanford.rate}}{% endifequal %}{% endfor %}" />%</td></tr>
{% endifequal %}
{% endfor %}

{% if errorinfo %}
{% ifequal onproject_id '3' %}
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red"></font></td>
<td class='even'><font color="red">{{errorinfo}}</font></td></tr>
{% endifequal %}
{% endif %}

<tr valign='middle' align='left'><td class='odd' width='25%'></td>
<td class='even'>&nbsp;<input type='submit' class='button' name='submit'  id='submit' value=' Submit '  />&nbsp;&nbsp;<a href="/clear_caterecord/3/" onclick="return confirm('Are you sure to clear the old record');"><font color='red'>Clear Old Record</font></a> <font color='blue'>{{pw}}</font></form></td></tr>
</table>
<br />
<!--  Iowa MBA -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<form name='form1' id='form1' action="/allocation_set_in/" method='post' >
<table width='650' class='grid' cellspacing='1' align='center'><tr><td colspan='2' class='title'>allocation setting</td></tr>
<tr valign='middle' align='left'></tr>

<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Porject:</td>
<td class='even'><input type="hidden" name="project_id" value="16" /> <font color='red'>Iowa MBA</font.></td></tr>
<!-- user group BEGIN -->
<tr valign='middle' align='left'><td class='odd' width='25%'>Choose area group</td>
<td class='even'>
<select name="group_id" class="group_sel">
  {% for agent in sg %}
	<option value="{{agent.id}}" {% ifequal agent.id defgroup %} selected {% endifequal %}>{{agent.name}}</option>
  {% endfor %}
</select>
</td></tr>
<!-- user group END -->
{% for sp in sp %}
{% ifequal sp.level 'sales' %}
<tr valign='middle' align='left' class='show_sel' gid="{{sp.group}}"><td class='odd' width='25%'><font color="red">*</font>{{sp.name}}:</td>
<td class='even'><input type="text" name="sp[{{sp.group}}][{{sp.id}}]" value="{% for iowa in iowambalist %}{% ifequal sp.id iowa.salesperson_id %}{{iowa.rate}}{% endifequal %}{% endfor %}" />%</td></tr>
{% endifequal %}
{% endfor %}

{% if errorinfo %}
{% ifequal onproject_id '16' %}
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red"></font></td>
<td class='even'><font color="red">{{errorinfo}}</font></td></tr>
{% endifequal %}
{% endif %}

<tr valign='middle' align='left'><td class='odd' width='25%'></td>
<td class='even'>&nbsp;<input type='submit' class='button' name='submit'  id='submit' value=' Submit '  />&nbsp;&nbsp;<a href="/clear_caterecord/16/" onclick="return confirm('Are you sure to clear the old record');"><font color='red'>Clear Old Record</font></a> <font color='blue'>{{psixteen}}</font></form></td></tr>
</table>

<br />
<!--  Berkeley Summer -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<form name='form1' id='form1' action="/allocation_set_in/" method='post' >
<table width='650' class='grid' cellspacing='1' align='center'><tr><td colspan='2' class='title'>allocation setting</td></tr>
<tr valign='middle' align='left'></tr>

<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Porject:</td>
<td class='even'><input type="hidden" name="project_id" value="18" /> <font color='red'>Berkeley Summer </font.></td></tr>
<!-- user group BEGIN -->
<tr valign='middle' align='left'><td class='odd' width='25%'>Choose area group</td>
<td class='even'>
<select name="group_id" class="group_sel">
  {% for agent in sg %}
	<option value="{{agent.id}}" {% ifequal agent.id defgroup %} selected {% endifequal %}>{{agent.name}}</option>
  {% endfor %}
</select>
</td></tr>
<!-- user group END -->
{% for sp in sp %}
{% ifequal sp.level 'sales' %}
<tr valign='middle' align='left' class='show_sel' gid="{{sp.group}}"><td class='odd' width='25%'><font color="red">*</font>{{sp.name}}:</td>
<td class='even'><input type="text" name="sp[{{sp.group}}][{{sp.id}}]" value="{% for bs in bs_list %}{% ifequal sp.id bs.salesperson_id %}{{bs.rate}}{% endifequal %}{% endfor %}" />%</td></tr>
{% endifequal %}
{% endfor %}

{% if errorinfo %}
{% ifequal onproject_id '18' %}
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red"></font></td>
<td class='even'><font color="red">{{errorinfo}}</font></td></tr>
{% endifequal %}
{% endif %}

<tr valign='middle' align='left'><td class='odd' width='25%'></td>
<td class='even'>&nbsp;<input type='submit' class='button' name='submit'  id='submit' value=' Submit '  />&nbsp;&nbsp;<a href="/clear_caterecord/18/" onclick="return confirm('Are you sure to clear the old record');"><font color='red'>Clear Old Record</font></a> <font color='blue'>{{psixteen}}</font></form></td></tr>
</table>

<br>
<!--  SMP -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<form name='form1' id='form1' action="/allocation_set_in/" method='post' >
<table width='650' class='grid' cellspacing='1' align='center'><tr><td colspan='2' class='title'>allocation setting</td></tr>
<tr valign='middle' align='left'></tr>

<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Porject:</td>
<td class='even'><input type="hidden" name="project_id" value="17" /> <font color='red'>SMP</font.></td></tr>
<!-- user group BEGIN -->
<tr valign='middle' align='left'><td class='odd' width='25%'>Choose area group</td>
<td class='even'>
<select name="group_id" class="group_sel">
  {% for agent in sg %}
	<option value="{{agent.id}}" {% ifequal agent.id defgroup %} selected {% endifequal %}>{{agent.name}}</option>
  {% endfor %}
</select>
</td></tr>
<!-- user group END -->
{% for sp in sp %}
{% ifequal sp.level 'sales' %}
<tr valign='middle' align='left' class='show_sel' gid="{{sp.group}}"><td class='odd' width='25%'><font color="red">*</font>{{sp.name}}:</td>
<td class='even'><input type="text" name="sp[{{sp.group}}][{{sp.id}}]" value="{% for smp in smp_list %}{% ifequal sp.id smp.salesperson_id %}{{smp.rate}}{% endifequal %}{% endfor %}" />%</td></tr>

{% endifequal %}
{% endfor %}

{% if errorinfo %}
{% ifequal onproject_id '17' %}
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red"></font></td>
<td class='even'><font color="red">{{errorinfo}}</font></td></tr>
{% endifequal %}
{% endif %}

<tr valign='middle' align='left'><td class='odd' width='25%'></td>
<td class='even'>&nbsp;<input type='submit' class='button' name='submit'  id='submit' value=' Submit '  />&nbsp;&nbsp;<a href="/clear_caterecord/17/" onclick="return confirm('Are you sure to clear the old record');"><font color='red'>Clear Old Record</font></a> <font color='blue'>{{pth}}</font></form></td></tr>
</table>
<script language="javascript" src="/static/js/jquery-1.2.1.pack.js" type="text/javascript"></script>
<script type='text/javascript'>
$(window).ready(function(){
	$('select.group_sel').each(function(){
		var val = $(this).val()
		$(this).parents('tbody').children('.show_sel').each(function(){
			$(this).show()
			if(val !=0){
				if(val != $(this).attr('gid')){
					$(this).hide()
				}
			}
		})
	})
})
$('select.group_sel').change(function(){
	var val = $(this).val()
	$(this).parents('tbody').children('.show_sel').each(function(){
		$(this).show()
		if(val !=0){
			if(val != $(this).attr('gid')){
				$(this).hide()
			}
		}
	})
})
</script>
{% endblock %}

